
import { onMounted, onUnmounted, ref } from "vue";
export function usePoint(){
  const x = ref(0);
  const y = ref(0);
  function handleClick(event:any){
    x.value = event.pageX
    y.value = event.pageY;
  }
  onMounted(()=> window.addEventListener('click',handleClick))
  onUnmounted(()=> window.removeEventListener('click',handleClick))
  return {x,y}
}